//-------------------------------------------------------------------------
/**
   File:   handle_closer.h

   Descr.: - todo -

*/
//-------------------------------------------------------------------------
#ifndef _HANDLE_CLOSER_H
#define _HANDLE_CLOSER_H

namespace detail 
{

class HandleCloseVisitor
{
public:
	// HANDLE
	void operator()(HANDLE& h) const {
		::CloseHandle(h);
	}

	// HKEY
	void operator()(HKEY& h) const {
		::RegCloseKey(h);
	}

	// HBITMAP
	void operator()(HBITMAP& h) const {
		::DeleteObject(h);
	}
};

} // namespace
#endif //!defined _HANDLE_CLOSER_H